This repository has been archived by the owner on Apr 4, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 15
Added: Comment Meta Endpoints #7
Merged
danielbachhuber
merged 5 commits into
WP-API:master
from
kjbenk:add/comment-meta-endpoints-2
Feb 26, 2016
Merged
Added: Comment Meta Endpoints #7
danielbachhuber
merged 5 commits into
WP-API:master
from
kjbenk:add/comment-meta-endpoints-2
Feb 26, 2016
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
return new WP_Error( 'rest_comment_invalid_id', __( 'Invalid comment id.' ), array( 'status' => 404 ) ); | ||
} | ||
|
||
if ( ! current_user_can( 'moderate_comments', $comment->comment_ID ) ) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
moderate_comments
doesn't accept a second param.
@kjbenk Can you resolve the merge conflict, and address the two minor comments? |
* REMOVED: ‘moderate_comments’ does not accept a second parameter * REMOVED: wp_set_current_user($this->admin_id); not needed for some unit tests
…dpoints-2 # Conflicts: # plugin.php
@danielbachhuber Ready to merge. |
return new WP_Error( 'rest_comment_invalid_id', __( 'Invalid comment id.' ), array( 'status' => 404 ) ); | ||
} | ||
|
||
if ( ! current_user_can( 'moderate_comments' ) ) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, I'd think this check should be edit_comment
again, no?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe since the edit_comment
cap is used when trying to delete a comment anyways.
* UPDATED: The `delete_item_permissions_check` function now uses the `edit_comment` cap instead of the `moderate_comments` cap
@danielbachhuber have a look now. |
danielbachhuber
added a commit
that referenced
this pull request
Feb 26, 2016
Added: Comment Meta Endpoints
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR adds the comment meta endpoints based on the issue #1.